﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Xml.Serialization;
using System.IO;

namespace ArgusLight.Fractals2D
{
	/// <summary>
	/// Any class which derives from <see cref="ColoringParameter"/> is expected to be seriazable
	/// with <see cref="XmlSerializer"/>. If the class contains Members, which are not by default
	/// seriazable with XmlSerializer, the class must implement <see cref="IXmlSerializable"/>.
	/// </summary>
	[XmlType(TypeName="ColoringBase")]
	public class ColoringParameter
	{
		public void XmlSerialize(Stream stream)
		{
			XmlSerializer xs = new XmlSerializer(this.GetType());
			xs.Serialize(stream, this);
		}

		public static ColoringParameter XmlDeserialize(Type ColoringParameterType, Stream stream)
		{
			XmlSerializer xs = new XmlSerializer(ColoringParameterType);
			return (ColoringParameter)xs.Deserialize(stream);
		}
	}
}
